package com.yiwyn.ood.srp;

// 单一职责
public class SRPDemo {


    public static void main(String[] args) {


    }

}

// 用户服务
class UserService {

    EmailService emailService = new EmailService();

    public void register(RegisterInfo info) {
        // 注册...
    }

    public void sendVerficationCode(String email) {
        // 发送验证码
        emailService.sendEmail(email);
    }
}

// 邮箱服务
class EmailService extends UserService {

    public void sendEmail(String email) {
        // 发送验证码
    }
}

class RegisterInfo {

}
